window.addEventListener('load',function(){
    let arrow_l = document.querySelector('.arrow-l');
    let arrow_r = document.querySelector('.arrow-r');
    let arrow_l1 = document.querySelector('.arrow-l1');
    let arrow_r1 = document.querySelector('.arrow-r1');
    let w2 = document.querySelector('.w2');
    let ul = w2.querySelector('ul');
    let li = ul.querySelector('li');
    let z2 = document.querySelector('.z2');
    let ul1 = z2.querySelector('ul');
    //右边轮播图
    let num = 0;
    let numr = 0;
    arrow_r.addEventListener('click',function(){
        let step = li.offsetWidth;
        if(num == 0){
            animate(ul,-(step*11));
            num++;
        }
        else if(num == 1){
            animate(ul,-(step)*14);
        }
    })

    arrow_l.addEventListener('click',function(){
        let step = li.offsetWidth;
        if(num == 1){
            animate(ul,-(step*11));
            num--;
        }
        else if(num == 0){
            animate(ul,0);
        }
    })

    arrow_l1.addEventListener('click',function(){
        if(numr == 1){
            animate(ul1,0);
            numr--;        
        }
    });

    arrow_r1.addEventListener('click',function(){
        if(numr == 0){
            animate(ul1,-500);
            numr++;        
        }
    });
});